<%-- 
    Document   : insert_pengguna
    Created on : 15 Des 12, 17:51:02
    Author     : sydon
--%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>JSP Page</title>
    </head>
    <body>
        <%
                    bean.DataBaseConnection conn = new bean.DataBaseConnection();
                    String id = request.getParameter("id_user");
                    String user = request.getParameter("user_name");
                    String password = request.getParameter("password_user");
                    System.out.println(request.getParameter("id_user"));
                    System.out.println(request.getParameter("user_name"));
                    System.out.println(request.getParameter("password_user"));
                    try {         
                        String query = "insert into pengguna values('"+id+ "','"+user+"','"+password+"')";
                        java.sql.Statement statementI = conn.getConnection().createStatement();
                        statementI.executeUpdate(query);
                        statementI.close();
                    } catch (Exception ex) {
                        System.out.println("message: " + ex.getMessage());
                    }
                    session.setAttribute("upload", "ok");
                    response.sendRedirect("admin_insert.jsp");
        %>
    </body>
</html>
